From e4eb721c4ff519e3cc069f54f49708ecdcd9859e Mon Sep 17 00:00:00 2001 From: parkrrrr Date: Thu, 11 Aug 2005 19:10:10 +0000 Subject: [PATCH] Fixed (new) memory leak --- gpsbabel/an1.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gpsbabel/an1.c b/gpsbabel/an1.c index 8f55c5745..0b72ce59c 100644 --- a/gpsbabel/an1.c +++ b/gpsbabel/an1.c @@ -261,6 +261,7 @@ void Destroy_AN1_Waypoint( void *vwpt ) { an1_waypoint_record *wpt = (an1_waypoint_record *)vwpt; xfree( wpt->name ); xfree( wpt->fontname ); + xfree( vwpt ); } void Copy_AN1_Waypoint( void **vdwpt, void *vwpt ) { @@ -284,7 +285,7 @@ static an1_waypoint_record *Alloc_AN1_Waypoint( ) { static an1_vertex_record *Alloc_AN1_Vertex(); void Destroy_AN1_Vertex( void *vvertex ) { - /* do nothing */ + xfree( vvertex ); } void Copy_AN1_Vertex( void **vdvert, void *vvert ) { @@ -309,6 +310,7 @@ static an1_line_record *Alloc_AN1_Line(); void Destroy_AN1_Line( void *vline ) { an1_line_record *line = (an1_line_record *)vline; xfree( line->name ); + xfree( vline ); } void Copy_AN1_Line( void **vdline, void *vline ) { @@ -613,7 +615,6 @@ Write_One_AN1_Waypoint( const waypoint *wpt ) Write_AN1_Waypoint( outfile, rec ); if ( local ) { Destroy_AN1_Waypoint( rec ); - xfree( rec ); } } @@ -753,7 +754,6 @@ Write_One_AN1_Line( const route_head *rte ) Write_AN1_Line( outfile, rec ); if ( local ) { Destroy_AN1_Line( rec ); - xfree( rec ); } } @@ -781,7 +781,6 @@ Write_One_AN1_Vertex( const waypoint *wpt ) Write_AN1_Vertex( outfile, rec ); if ( local ) { Destroy_AN1_Vertex( rec ); - xfree( rec ); } } -- 2.30.2